"""sassexercise URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import include

from apps.web.views import home
from apps.web.views import account
from apps.web.views import project
from apps.web.views import wiki
from apps.web.views import  file
from apps.web.views import dashboard

urlpatterns = [
    url(r'^register/$', account.register, name="register"),
    url(r'^login/sms/$', account.login_sms, name="login_sms"),
    url(r'^login/$', account.login, name="login"),
    url(r'^image/code/$', account.image_code, name="image_code"),
    url(r'^send/sms/$', account.send_sms, name="send_sms"),
    url(r'^logout/$', account.logout, name="logout"),
    url(r'index/$', home.index, name="index"),
    # 项目表
    url(r'^project/list/$', project.project_list, name="project_list"),
    # 点击添加星标
    url(r'^project/star/(?P<project_type>\w+)/(?P<project_id>\d+)/$', project.project_star, name='project_star'),
    # 取消星标
    url(r'^project/unstar/(?P<project_type>\w+)/(?P<project_id>\d+)/$', project.project_off_star,
        name='project_off_star'),

    url(r'^manage/(?P<project_id>\d+)/', include([
        url(r'^wiki/$', wiki.wiki, name="wiki"),
        url(r'^wiki/catalog/$', wiki.wiki_catalog, name='wiki_catalog'),
        url(r'^wiki/add/$', wiki.wiki_add, name='wiki_add'),
        url(r'^wiki/delete/(?P<wiki_id>\d+)/$',wiki.wiki_delete,name='wiki_delete'),
        url(r'^wiki/edit/(?P<wiki_id>\d+)/$', wiki.wiki_edit, name='wiki_edit'),
        url(r'^wiki/upload/$', wiki.wiki_upload, name='wiki_upload'),
        url(r'^dashboard/$', dashboard.dashboard, name='dashboard'),

        # 文件
        url(r'^file/$',file.file,name="file"),

    ],None,None)),

]
